body {
  margin: 0;
}

#app {
  max-width: 1280px;
  height: 100vh;
  margin: 0 auto;
}

#header {
  box-sizing: border-box;
  padding: 5px 10px;
  height: 50px;
  display: flex;
  justify-content: space-between;
}

#data-container {
  height: calc(100% - 50px);
  overflow: auto;
}

#list {
  width: 100%;
  box-sizing: border-box;
}

.item {
  padding: 10px;
  display: flex;
  justify-content: space-between;
  position: relative;
  border-bottom: 1px solid #eaeaea;
}

.item-left {
  display: flex;
}

.item-right {
  display: flex;
  width: 200px;
  flex: 0 0 auto;
  gap: 10px;
}

.state-container {
  display: flex;
}

.address {
  width: 200px;
  word-break: keep-all;
  white-space: nowrap;
  display: flex;
  justify-content: flex-end;
}

.ip {
  text-align: right;
}

.port {
  display: block;
  margin-right: 20px;
  width: 60px;
  color: #104e96;
}

.name {
  color: #888;
  font-size: small;
}

.state {
  margin-right: 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
}

.delay {
  width: 80px;
}

.delay-state--0 {
  color: #757575;
}

.delay-state--1 {
  color: #058124;
}

.delay-state--2 {
  color: #8aa709;
}

.delay-state--3 {
  color: #e9ad07;
}

.delay-state--4 {
  color: #e90707;
}

.item.dead .state {
  background-color: #ed5656;
  border: 1px solid #f8b4b4;
}
.item.dead .state:hover {
  box-shadow: 0 0 10px 3px red;
}

.item.dead .ip,
.item.dead .port {
  color: #ed5656;
}

.item.alive .state:hover {
  box-shadow: 0 0 10px 3px green;
}

.item.alive .state {
  background-color: #66f466;
  border-color: #0a9a0a;
}

.timestamp {
  color: #757575;
  justify-self: flex-end;
}

.btn-remove {
  color: #757575;
  border: none;
  padding: 0;
  color: blue;
  cursor: pointer;
  background: none;
  text-decoration: underline;
  display: none;
}

.btn-remove:hover {
  color: #ff6666;
}

.item:hover {
  background-color: #f5f5f5;
}

.item:hover .btn-remove {
  display: block;
}

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  margin-bottom: 40px;
}

form > label > span {
  display: inline-block;
  width: 80px;
  text-align: right;
}

#dialog-btns {
  display: flex;
  justify-content: space-between;
}

button {
  padding: 5px 10px;
}

#btn-refresh {
  margin-right: 20px;
}

#loading {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.1);
  padding: 20px;
  border-radius: 5px;
  z-index: 98765;
}

.loading-text {
  color: #555;
}

/* 列表视图样式，保持原有样式 */
#list.list-view .item {
  /* 可以根据需要调整列表视图的样式 */
  display: flex;
}

/* 网格视图样式 */
#list.grid-view {
  gap: 20px; /* 卡片之间的间距 */
  padding: 20px; /* 列表容器内边距 */
  display: flex;
  flex-wrap: wrap;
}

#list.grid-view .item {
  border: 1px solid #ccc;
  flex-direction: column;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease-in-out;
  height: 120px;
  width: 280px;
  box-sizing: border-box;
}

#list.grid-view .item:hover {
  transform: translateY(-5px); /* 鼠标悬停时卡片上移 */
}

#list.grid-view .item-left {
  flex-direction: column;
  gap: 5px;
}

#list.grid-view .address {
  justify-content: flex-start;
}

#list.grid-view .name {
  width: 100%;
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#list.grid-view .btn-remove {
  position: absolute;
  right: 10px;
  top: 10px;
}
